package com.boot.security.server.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class WebMvcConfigurer extends WebMvcConfigurerAdapter {

    public void addInterceptors(InterceptorRegistry registry){
        List list = new ArrayList();
        list.add("/home/login/**");
        list.add("/home/manage/**");
        
        list.add("/home/index.html");
        //指定拦截器类
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/home/**").excludePathPatterns("/home/login/login.html","/home/css/**","/home/js/**","/home/fonts/**","/home/img/**");        //指定该类拦截的url
        registry.addInterceptor(new JhInterceptor()).addPathPatterns("/manager/admin/**");
        
    }
    
}
